<div class='container-fluid'>
    <div class='row-fluid'>
        <div class='span12'>
            <div class='row-fluid'>
                <div class='span12'>
                    <div class='page-header'>
                        <h1>
                            <i class='icon-upload-alt'></i>
                            <span>Add images</span>
                        </h1>
                    </div>
                </div>
            </div>
            <div class='row-fluid'>
                <div class='span12'>
                    <div class='page-header'>
                        <?=Form::open('backend', array('id' => 'add-images-form', 'class' => 'form-horizontal', 'enctype' => 'multipart/form-data'))?>

                        <?if($errors):?>
                            <div class="control-group">
                                <div class="controls">
                                    <div class=' box'>
                                        <div class='box-header red-background'>
                                            <div class='lead'>
                                                <div class='icon-exclamation-sign'></div>
                                                Filled incorrect
                                            </div>
                                            <div class='actions'>
                                                <a class='btn box-remove' href='#'>
                                                    <i class='icon-remove'></i>
                                                </a>
                                            </div>
                                        </div>
                                        <div class='box-content'>
                                            <div class='thumbnail'>
                                                <ul>
                                                    <?foreach ($errors as $error):?>
                                                    <li><?=$error?></li>
                                                    <?endforeach?>
                                                </ul>
                                            </div>
                                        </div>
                                    </div>

                                </div>
                            </div>
                        <?endif?>

                            <div class="control-group">
                                <label class="control-label">Upload image</label>
                                <div class="controls">
                                    <?=Form::file('images[]', array('class' => 'multi max-5 accept-png|jpg'))?>
                                </div>
                            </div>
                            <div class="form-actions">
                                <?=Form::submit('submit', 'Save', array('class' => 'btn btn-primary btn-large'));?>
                            </div>
                        <?=Form::close()?>
                    </div>
                </div>
            </div>
            <div class='row-fluid'>
                <div class='span12'>
                    <div class='page-header'>
                        <h1>
                            <i class='icon-picture'></i>
                            <span>List images</span>
                        </h1>
                    </div>
                </div>
            </div>
            <div class='row-fluid'>
                <div class='span12 box'>
                    <div class='alert alert-info'>
                        <a class='close' data-dismiss='alert' href='#'>&times;</a>
                        Try to click on dashed links in table below and see what it can do!
                    </div>
                    <div class='thumbnail'>
                        <div class='inner-spacer'>
                        <?if (count($images) > 0):?>
                            <table class='table table-hover table-bordered table-striped' id='user'>
                                <tbody>
                                <?foreach($images as $i =>  $image):?>
                                <tr class="row_<?=$image->id?>">
                                    <td width="200px"><?=HTML::image(Model_Image::DIRECTORY_PATH."small_".$image->name, array('class' => 'img-circle'))?></td>
                                    <td width="50px"><?=$image->user->email?></td>
                                    <td width="450px">
                                        <a data-original-title='Enter comments' data-pk='<?=$image->id?>' data-name='text' data-placeholder='Your comments here...' data-type='textarea' href='javascript:void(0);' class='comments'>
                                            <?=$image->text?>
                                        </a>
                                    </td>
                                    <td>
                                        <div class="btn btn-mini btn-danger delete" >Delete</div>
                                    </td>
                                </tr>
                                <?endforeach?>
                                </tbody>
                            </table>
                        <?else:?>
                            <p class="muted" style="margin-top: 5px;">No images</p>
                        <?endif?>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>